package com.yt.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @Classname TestController
 * @Description
 * @Date 2021/10/27 16:53
 * @Create by 杨涛
 */
@RestController
@Slf4j
@RefreshScope
public class TestController {
    @Value("${config.info}")
    private String info;

    @GetMapping("/testa")
    public String testa() {
//        try {
//            TimeUnit.MILLISECONDS.sleep(800);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        log.warn("**********************test A **********************\n" + info);
        return "test A";
    }

    @GetMapping("/testb")
    public String testb() {
//        try {
//            TimeUnit.MILLISECONDS.sleep(500);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        log.warn("**********************test B   *********************\n" + info);
        return "test B";
    }
}
